﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="email_wdyj_list.aspx.cs" Inherits="Ccit.OA.Email.email_wdyj_list" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v8.1" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v8.1" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>
<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
   <script language="javascript" src="../script/jquery.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jbase64.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jsonlib.js" type="text/javascript" ></script>
    <script language="javascript" src="../script/StringClass_Ext.js" type="text/javascript" ></script>
    <script type="text/javascript">
        function doDel() //删除
        {
            var sId = document.getElementById("hidIds").value;
            if(sId == "")
            {
                alert('请先选择要删除的邮件!');
                return false;
            }
            if(confirm("确定删除已选定的邮件?"))
            {
                var jsonStr = jsonObj();
                PageMethods.DelEmail(jsonStr,"DelEmail",ClientCallBack);
            }
        }
        
        function doFind()  //转移到
        {
            var sId = document.getElementById("hidIds").value;
            if(sId == "")
            {
                alert('请先选择要转移的邮件!');
                return false;
            }
            var jsonStr = jsonObj();
            PageMethods.FindEmail(jsonStr,"FindEmail",ClientCallBack); 
        }
    
    
        function jsonObj(fileID) //返回序列化后的字符串
        {
            var MsRecord ={};
                MsRecord.Id = document.getElementById("hidJLBH").value;
                MsRecord.emailId = document.getElementById("hidIds").value;
                MsRecord.userId = document.getElementById("hidUserId").value;
                MsRecord.folderId = document.getElementById("ddlYJJ").options[document.getElementById("ddlYJJ").selectedIndex].value;
                MsRecord.statelogo = document.getElementById("hidType").value;
                MsRecord.readlogo = "";
                MsRecord.agencId = "";
                MsRecord.deptId = "";
                MsRecord.jobId = "";
                MsRecord.levelId = "";
                MsRecord.cjuserId = "";
                MsRecord.cjdatetime = "";
                var jsonStr = JSON.stringify(MsRecord,function(key,value){return value;});  
                return jsonStr;
        }
    
    
     function ClientCallBack(vResult) {
     
               eval("var resultObj=" + vResult);
            var operType = resultObj.operType;
            var resultSign = resultObj.resultSign;
            switch (operType) {
                case "DelEmail": 
                    if (resultSign == "0") {
                        alert("删除失败!");
                    }
                    else {
                        alert("删除成功!");
                        window.location.href = "email_wdyj_list.aspx?"+document.getElementById("hidParams").value;
                    }
                    break;
                 case "FindEmail":
                    if (resultSign == "0") {
                        alert("邮件转移失败!");
                    }
                    else{
                        //alert("邮件转移成功!");
                        window.location.href = "email_wdyj_list.aspx?"+document.getElementById("hidParams").value;
                    }
                    break;
            }
        }
    </script>
</head>
<body>  
<ccit:ActionForm id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server" />
        
          <input type="hidden" id="hidIds" runat="server" />
          <input type="hidden" id="hidUserId" runat="server" />
          <input type="hidden" id="hidFolder" runat="server" />
          <input type="hidden" id="hidParams" runat="server" />
          <input type="hidden" id="hidVar" runat="server" />
          <input type="hidden" id="hidType" runat="server" />
          <input type="hidden" id="hidJLBH" runat="server" />
          <input type="hidden" id="hidspaceLast" runat="server" />
        			<table class="tbToolbar" cellSpacing="0" cellPadding="0" width="98%" align="center" border="0">
				<tr>
					<td align="left">
						<div class="tbSeparator"></div>
					</td>
					<td class="titlebar" width="100%">
							<img src="../images/public/pageicon.gif" border="0">
							电子邮件 -&gt;<asp:Label ID="lbTitle" runat="server"></asp:Label>
							<IMG src="../images/public/listicon.gif" border="0">
					</td>
					<td align="right">
						<div class="tbSeparator"></div>
					</td>
					<td>
					    <nobr>
						<a href="email_write.aspx" Class="linktext">
						<IMG src="../images/toolbar/new.GIF" align="middle" border="0">撰写新邮件</a>
						</nobr>
					</td>
					<td align="right" runat="server">
					    <nobr>
						<asp:linkbutton id="lnkDel" runat="server" CssClass="linktext">
						<IMG src="../images/toolbar/delete.GIF" align="middle" border="0">删除</asp:linkbutton>
						</nobr>
					</td>
					<td align="right" runat="server">
					    <nobr>
						<asp:linkbutton id="lnkFind" runat="server" CssClass="LinkText">
						<IMG src="../images/toolbar/redo.GIF" align="middle" border="0">转移到</asp:linkbutton>
						</nobr>
					</td>
					<td align="right" id="tdHtmlSize" runat="server">
						<asp:DropDownList Runat="server" id="ddlYJJ" CssClass="inputselect" Width="200px"></asp:DropDownList>
					</td>					
					<td>
					    <nobr>
						<a href="javascript:location.href='email_wdyj_index.aspx';" Class="LinkText"><IMG src="../images/toolbar/back.GIF" align="middle" border="0">返回</a>
					    <nobr>
					</td>					
					<td align="left">
						<div class="tbSeparator"></div>
					</td>
				</tr>
			</table>
			
			 <table cellspacing="0" cellpadding="0" align="center" border="0"  style="WIDTH:98%;HEIGHT:441px">
			<tr height="100%" valign="top">
				<td  width="18%" style="background-color:#EEF2F7; BORDER-RIGHT: #000000 1px solid" id="tdEmailShow" runat="server">
              
				</td>
				<td>
                <dxwgv:ASPxGridView ID="grid" 
                             
                            Width="100%" 
                            AutoGenerateColumns="False" 
                            KeyFieldName="YJID"
                            Settings-ShowFooter="false"
                            runat="server" onhtmlrowcreated="grid_HtmlRowCreated"  EnableCallBacks="false">
                         
              <Columns>     

               <%-- 复选框选择--%>
                <dxwgv:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" Width="3%">
                        <HeaderTemplate>
                            <input id="chkCheck" class="checkbox" type="checkbox" runat="server" onclick="grid.SelectAllRowsOnPage(this.checked);" style="vertical-align:middle;" title="Select/Unselect all rows on the page"></input>
                        </HeaderTemplate>
                        <HeaderStyle Paddings-PaddingTop="1" Paddings-PaddingBottom="1" HorizontalAlign="Center">
                            <Paddings PaddingTop="1px" PaddingBottom="1px"></Paddings>
                        </HeaderStyle>
                    </dxwgv:GridViewCommandColumn>
                            
                            
                <dxwgv:GridViewDataTextColumn Caption="" FieldName="YJID" Visible="false" ShowInCustomizationForm="false" VisibleIndex="1"></dxwgv:GridViewDataTextColumn>

                 <dxwgv:GridViewDataTextColumn VisibleIndex="2" Caption="<img src='..\images\toolbar\priority.gif' border=0>" Width="5%">
		            <HeaderStyle ></HeaderStyle>
			     </dxwgv:GridViewDataTextColumn>
				<dxwgv:GridViewDataTextColumn VisibleIndex="3" Caption="<img src='..\images\toolbar\Mail.gif' border=0>" Width="5%">
					<HeaderStyle ></HeaderStyle>
				</dxwgv:GridViewDataTextColumn>
				<dxwgv:GridViewDataTextColumn VisibleIndex="4" Caption="<img src='..\images\toolbar\Attach.gif' border=0>" Width="5%">
					<HeaderStyle ></HeaderStyle>
				</dxwgv:GridViewDataTextColumn>
								
                <dxwgv:GridViewDataTextColumn Caption="发件人" FieldName="FJR" VisibleIndex="5" Width="20%">
                    <HeaderStyle HorizontalAlign="center" />
                    <CellStyle HorizontalAlign="center"></CellStyle>
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataColumn Caption="收件人" FieldName="SJR" VisibleIndex="6" Width="20%">
                  <HeaderStyle HorizontalAlign="center" />
                    <CellStyle HorizontalAlign="center"></CellStyle>
                </dxwgv:GridViewDataColumn> 
                <dxwgv:GridViewDataTextColumn Caption="主题" FieldName="YJBT" VisibleIndex="7" Width="30%"  >
                     <HeaderStyle HorizontalAlign="center" />
                     <CellStyle HorizontalAlign="Left"></CellStyle>
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn Caption="接收时间" FieldName="JSSJ" VisibleIndex="8" Width="20%">
                     <HeaderStyle HorizontalAlign="center" />
                     <CellStyle HorizontalAlign="center"></CellStyle>
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn Caption="大小" FieldName="YJDX" VisibleIndex="9" Width="15%">
                     <HeaderStyle HorizontalAlign="center" />
                     <CellStyle HorizontalAlign="Right"></CellStyle>
                </dxwgv:GridViewDataTextColumn>  
                <dxwgv:GridViewDataTextColumn Caption="是否阅读" FieldName="SFYD" Visible="false" VisibleIndex="10">
                     <HeaderStyle HorizontalAlign="center" />
                     <CellStyle HorizontalAlign="Right"></CellStyle>
                </dxwgv:GridViewDataTextColumn>  
                <dxwgv:GridViewDataTextColumn Caption="收件人标志" FieldName="SJRBZ" Visible="false" VisibleIndex="11">
                     <HeaderStyle HorizontalAlign="center" />
                     <CellStyle HorizontalAlign="Right"></CellStyle>
                </dxwgv:GridViewDataTextColumn>  
                <dxwgv:GridViewDataTextColumn Caption="记录ID" FieldName="YJJL" Visible="false" VisibleIndex="12">
                     <HeaderStyle HorizontalAlign="center" />
                     <CellStyle HorizontalAlign="Right"></CellStyle>
                </dxwgv:GridViewDataTextColumn>  
                          
                
             
                    </Columns>
            
            
             
            <%-- 设置页脚中分页 --%>
            <SettingsPager PageSize=13 Mode="ShowPager" AlwaysShowPager=true
                 FirstPageButton-Visible=true LastPageButton-Visible=true  
                 FirstPageButton-Image-AlternateText="" LastPageButton-Image-AlternateText="尾页"
                 NumericButtonCount=5  SEOFriendly="Disabled"
                 PrevPageButton-Visible="true" NextPageButton-Visible="true"
                 ShowSeparators=true Position="Bottom">
                    <FirstPageButton Visible="True"></FirstPageButton>
                    <LastPageButton Visible="True">
                    <Image AlternateText="尾页"></Image>
                    </LastPageButton>
            </SettingsPager>
                 
            <%-- 复选框选择脚本事件--%>
            <ClientSideEvents SelectionChanged="function(s,e){OnGridSelectionChanged();}"
                 CustomizationWindowCloseUp="function(s,e){ UpdateCustomizationWindowValue();}"
             />
            
            <%-- 设置行样式--%>
            <Styles>
                <Row CssClass=""></Row>
                <AlternatingRow  CssClass="" Enabled="true"/>
                <SelectedRow  CssClass=""></SelectedRow>                
            </Styles>
            <%--  显示过滤行--%>
            <Settings ShowFilterRow="false" ShowPreview="True"/>
            
            <%-- 可调整列宽--%>
            <SettingsBehavior ColumnResizeMode="Control" />
            
            <%-- 自定义表头--%>
            <SettingsCustomizationWindow Enabled="true" />
        </dxwgv:ASPxGridView>
				</td>
			</tr>
		</table>
		 <script language="javascript" type="text/javascript">
            <!--
            /* 复选框选择 */
            function OnGridSelectionChanged(){
                grid.GetSelectedFieldValues("YJID",OnGridSelectionComplete);
                grid.GetSelectedFieldValues("YJJL",OnGridSelectionCompleteJLID);
            }
            
            function OnGridSelectionComplete(values){
                document.getElementById("hidIds").value = values;
            }
            
            function OnGridSelectionCompleteJLID(values){
                document.getElementById("hidJLBH").value = values;
            }
            //-->
        </script>
    </ccit:ActionForm>
	</body>
</html>
